
package com.remoteblogger.blogeditor;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;

public final class NewWeblog implements ActionListener {

    @Override
    public void actionPerformed(ActionEvent e) {
        System.out.println("action performed successfull");
        NewWeblogPanel newWeblogPanel = new NewWeblogPanel();

        // this is a basic implementation of dialog descriptor more can be done in the future
        //http://ui.netbeans.org/docs/ui_apis/dide/index.html\
        // muast make the weblog panel bigger for impressive UI
        DialogDescriptor dd = new DialogDescriptor(newWeblogPanel, "New Weblog");
        DialogDisplayer.getDefault().notify(dd);

        if(dd.getValue () == DialogDescriptor.OK_OPTION) {
            System.out.println("I just pressed the ok button!!");
            newWeblogPanel.createWeblog();
        } else {
            System.out.println("I pressed the cancel button");
        }

        System.out.println("I reached here also");
        
    }
}
